package com.wxh.excel;

import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * @ClassName: ExcelService
 * @Description:
 * @Author wxh
 * @Date: 2021/12/3 15:03
 * @Version V1.0.0
 * @Since 1.8
 */
public interface ExcelService {
    /**
     * post请求，导出数据到Excel中
     * @param paramList 请求参数集合
     * @param response http响应对象
     */
    void exportToExcel(List<Map<String, Object>> paramList, HttpServletResponse response);

    /**
     * get请求，导入Excel的数据到表中
     * @param file 多部分文件对象
     * @param request http请求对象
     * @param response http响应对象
     */
    void importExcel(MultipartFile file, HttpServletRequest request, HttpServletResponse response);

    /**
     * 下载文件
     * @param request http请求对象
     * @param response http响应对象
     * @param fileName 文件名
     */
    void downloadExcel(HttpServletRequest request, HttpServletResponse response, String fileName);
}
